<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>  
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap/css/bootstrap.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/static/jquery/jquery-2.2.4.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script	src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript">
   $(document).ready(function(){
       /* var wd = $(".nav-pills").width();*/
        jQuery(window).scroll(function() {
            $("#top_cate").css("z-index", 9999);
        });

        $("#top_cate").affix({
            offset: {
                top: 25,
                bottom: function () {
                    return (this.bottom = $('.bottom').outerHeight(true));
                }

            }
        });
    });
</script>

<div class="container">
<div class="row">
		
		<div class="col-md-12 text-right">
			
			<ol class="breadcrumb" id="info">
				<c:if test="${sessionScope['_LOGIN_USER_']==null}">
					<li id="li1"><span>游客您好，欢迎来到服装专卖店！</span>
					<a href="#loginFormModal" data-toggle="modal">[登录]</a>&nbsp;<a href="#regFormModal" data-toggle="modal">[新用户注册]</a></li>
					<li><a href="#" onclick="showCart()">购物车 <span class="badge" id="cartBadge"></span></a></li>
				</c:if>
				<c:if test="${sessionScope['_LOGIN_USER_']!=null}">
					<li id="li1"><span>${fn:escapeXml(sessionScope['_LOGIN_USER_'].userName) }您好，欢迎来到良品专卖店！</span>										
					<li><a href="#" onclick="showCart()">购物车 <span class="badge" id="cartBadge"></span></a></li>
					<li><a href="${pageContext.request.contextPath}/order/getMyOrders">我的订单</a></li>
					<li><a href="${pageContext.request.contextPath}/usercenter/index">个人中心</a></li>
					<li><a href="#" onclick="logout()">退出登录</a></li>
				</c:if>
			</ol>
			
		</div>
		
		<div class="col-md-12 " id="top_cate">
			<nav class="navbar navbar-default navbar-static-top" role="navigation">
					
				<div class="navbar-header">
				 
					<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						 <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
					</button> <a class="navbar-brand" href="#">良品服装专卖店</a>
				</div>
				
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav" id="nav">
						<li class="active">
							<a href="${pageContext.request.contextPath}/">网站首页</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/goods/getNewGoods">新到商品</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/goods/getSalesGoods">热销商品</a>
						</li>
						<li class="dropdown">
							<a class="dropdown-toggle" href="#" data-toggle="dropdown">商品分类<strong class="caret"></strong></a>
							<ul class="dropdown-menu" id="dropdown_cate">

								<a class="list-group-item" href="#">女装</a>
								<a class="list-group-item" href="#">男装</a>
								<a class="list-group-item" href="#">鞋子</a>
								<a class="list-group-item" href="#">电脑</a>
								<a class="list-group-item" href="#">手机</a>

							</ul>
						</li>
					</ul>

					<form class="navbar-form navbar-left form-inline " role="search" method="post" action="${pageContext.request.contextPath}/goods/searchGoods">
						<div class="form-group">
							<input class="form-control " type="text" name="keyword" value="${fn:escapeXml(param.keyword)}"/>
						</div> 
						
						<button class="btn btn-default" type="submit">
							店内搜索
						</button>
					</form>

					<ul class="nav navbar-nav navbar-right">
						<li class="" >
							<a href="${pageContext.request.contextPath}/productAdd.jsp" style="color: #2aabd2">添加</a>
						</li>
						
						<li class="dropdown" >
							<a class="dropdown-toggle" href="#" data-toggle="dropdown">排序<strong class="caret"></strong></a>
							<ul class="dropdown-menu">
								<c:if test="${param.keyword!=null}">
									<li>
										<a href="#">按价格从低到高</a>
									</li>
									<li>
										<a href="#">按价格从高到低</a>
									</li>								
									<li class="divider">
									</li>
									<li>
										<a href="#">按销量从高到低</a>
									</li>
									<li>
										<a href="#">按销量从低到高</a>
									</li>
								</c:if>
								<c:if test="${param.keyword==null}">
									
									<li>
										<a href="#">按价格从低到高</a>
									</li>
									<li>
										<a href="#">按价格从高到低</a>
									</li>								
									<li class="divider">
									</li>
									<li>
										<a href="#">按销量从高到低</a>
									</li>
									<li>
										<a href="#">按销量从低到高</a>
									</li>
								</c:if>
							</ul>
						</li>
						<li class="col-md-2"></li>
					</ul>
				</div>
				
			</nav>
		</div>
</div>

</div>